<include file="Public/head"/>

<body class="no-skin">
<include file="Public/header"/>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <include file="Public/sidebar"/>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <include file="Public/breadcrumbs"/>
            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">
                <include file="Public/set"/>

                <!-- /section:settings.box -->
                <div class="row">
                     <div class="cf">
                            <form class="form-inline" action="" method="get">
                            <a class="btn btn-info" href="{:U('add')}" value="">新增</a>
                                <label class="inline">标题</label>
                                <input type="text" name="title" id="title" value="{:I('title')}" class="form-control">
                                
                                <button type="button" onclick="sou()" class="btn btn-purple btn-sm">
                                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                                    搜索
                                </button>
                            </form>
                        </div>
                    <div class="space-4"></div>
                      <table class="table table-striped table-bordered">
                            <thead>
                            <tr>
                                <th class='center'>ID</th>
                                <th class='center'>标题</th>
                                <th class='center'>图片</th>
                                <th class='center'>添加时间</th>
                                <th class='center'>操作</th>
                            </tr>
                            </thead>
                            <tbody>

                            <?php if($data){
                                foreach($data as $val){ ?>
                                 <tr>

                                     <td class='center'><?php echo $val['id']?></td>
                                     <td class='center' ><?php echo $val['title']?></td>
                                     <td class='center'><?php ?>
                                     	<?php foreach($val['content'] as $k=>$v){ ?>
                                     		<img alt="" src="<?php echo $v ?>" width='80' height=''>
                                     	
                                     	<?php }?>
                                     </td>

                                     <td class='center'>
                                     	<?php if(!empty($val['add_time'])){ ?>
												{$val['add_time']|date="Y-m-d ",###}
										 <?php } ?>
                                     </td>

                                    <td class='center'>
                                
                                         		<a href="<?php echo U('edit',array('id'=>$val['id']));?>"><i
                                              	 class="ace-icon fa fa-pencil bigger-100 red"></i>编辑</a>
                                             <a href="javascript:;" val="<?php echo U('del',array('id'=>$val['id']));?>" class="del"><i
                                                class="ace-icon fa fa-trash-o bigger-100 red"></i>删除</a>
                                    </td>

                                </tr>
                           
                            <?php }}else{echo "<tr align='center'><td colspan='9'>暂未发布园地信息！</td></tr>";}?>
                            </tbody>
                        </table>
                    {$page}
                    <!-- PAGE CONTENT ENDS -->
                </div><!-- /.col -->
            </div><!-- /.row -->
        </div><!-- /.page-content -->
    </div>
</div><!-- /.main-content -->
<include file="Public/footer"/>

</div><!-- /.main-container -->

<include file="Public/footerjs"/>
<!-- inline scripts related to this page -->
<script type="text/javascript">
$(".del").click(function () {
    var url = $(this).attr('val');

    bootbox.confirm({
        title: "系统提示",
        message: "确定要删除幼儿园地吗?",
        callback: function (result) {
            if (result) {
                window.location.href = url;
            }
        },
        buttons: {
            "cancel": {"label": "取消"},
            "confirm": {
                "label": "确定",
                "className": "btn-danger"
            }
        }
    });
});

    function sou(){
        var title = $('#title').val();

        var param = '';
        if(title){
            param += '/title/'+title;
        }

        
        location.href="__APP__/Admin/Corner/index"+param+".html";
    }
</script>
</body>
</html>
